const screenWidth = window.innerWidth
const screenHeight = window.innerHeight

class shopAspect{
  constructor(){

  }
  
}

export default class item {
  constructor(index, name, price){
    this.clr = "#ffffff"
    this.name = name
    this.sz = screenHeight * 0.04
    this.ht = screenHeight * 0.07 + (index + 1) * screenHeight * 0.05
    this.icon = 'images/astray/' + this.name + '2.png'
    this.price = price
  }
  view(){
    return [{src: this.icon, pos: [screenWidth * 0.14, this.ht, this.sz, this.sz]},
      {value: this.price.toString(), font: screenHeight * 0.03 + 'px Arial', pos: [screenWidth * 0.34, this.ht + screenHeight * 0.03], color: this.clr},
      {src: 'images/astray/coin.png', pos: [screenWidth * 0.42, this.ht, this.sz, this.sz]}]
  }
  pointIsIn(x, y){
    return x > screenWidth * 0.26 && x < screenWidth * 0.71 + this.sz && (y > this.ht + 0.1 * screenHeight) && y < this.ht + this.sz + 0.1 * screenHeight
  }
}